package TankFrst;

import java.awt.*;
//爆炸效果
public class Explode {
    TankClient tc;
    int x,y;
    private boolean live =true;

    public Explode(TankClient tc, int x, int y) {
        this.tc = tc;
        this.x = x;
        this.y = y;
    }

    int [] diameter={4,7,12,18,26,32,49,14,6};
    int step=0;
//画出爆炸效果，等添加图片后可以省略这一步
    public void draw(Graphics g){
        if (!live) {
            tc.explodes.remove(this);
            return;
        }
        if (step==diameter.length){
            live=false;
            return;
        }

        Color c=g.getColor();
        g.setColor(Color.ORANGE);
        g.fillOval(x,y,diameter[step],diameter[step]);
        g.setColor(c);
        step++;
    }
}
